package junior.sample.support.db;

import junior.db.dao.base.AbstractFilter;

/**
 * @author wubo
 * @date 2024/9/2 14:30
 */
public class DbHelper {
    public static final String IS_DELETED = "isDeleted";
    
    /**未删除*/
    public static final int DELETE_NO = 0;
    /**已删除*/
    public static final int DELETE_YES = 1;
    
    public static void filterDefaulted(AbstractFilter<?> param) {
        filterUndeleted(param);
    }
    
    public static void filterUndeleted(AbstractFilter<?> param) {
        if (! param.hasFilter(IS_DELETED)) {
            param.eq(IS_DELETED, DELETE_NO);
        }
    }
    
    private DbHelper() {}
}
